<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
哈哈
    <script type="text/javascript">
        //依赖H5
        var event  = new EventSource("sse");
        event.onmessage=function(e,f) {
            console.log("获取到",e.data,e);
            if(e.data==3){
                event.close();
            }
        }
        //默认会重复获取信息，可以通过判断停止事件
        event.addEventListener("me",function(e){
            console.log("获取到",e.data,e);
            if(e.data==3){
                event.close();
            }
        });
    </script>
</body>
</html>